package com.wjerp.tplus.server;

import com.alibaba.fastjson.JSON;
import com.wjerp.tplus.server.common.model.InvoiceCheckResponse;
import com.wjerp.tplus.server.common.model.WxApiResponseData;
import com.wjerp.tplus.server.common.utils.ProducePDF;

import java.io.File;
import java.io.IOException;

public class Test1 {
    public static void main(String[] args) throws Exception {
        //String invoiceResult = "{\"code\":\"10000\",\"charge\":false,\"remain\":0,\"msg\":\"查询成功\",\"result\":{\"message\":{\"status\":2,\"value\":\"查询成功\"},\"invoice\":[{\"invoiceLists\":[{\"invoiceList\":[{\"veritem\":[{\"desc\":\"货物或应税劳务名称\",\"name\":\"commodityName\",\"content\":\"*电子计算机*服务器\"},{\"desc\":\"规格型号\",\"name\":\"specificationModel\",\"content\":\"TG8221\"},{\"desc\":\"单位\",\"name\":\"unit\",\"content\":\"台\"},{\"desc\":\"数量\",\"name\":\"quantity\",\"content\":\"1.0\"},{\"desc\":\"单价\",\"name\":\"unitPrice\",\"content\":\"10398.230088495575221\"},{\"desc\":\"金额\",\"name\":\"amount\",\"content\":\"10398.23\"},{\"desc\":\"税率\",\"name\":\"taxRate\",\"content\":\"0.13\"},{\"desc\":\"税额\",\"name\":\"tax\",\"content\":\"1351.77\"}]}]}],\"veritem\":[{\"desc\":\"发票类型\",\"name\":\"invoiceType\",\"content\":\"04\"},{\"desc\":\"所属行政区名称\",\"name\":\"administrativeDivisionName\",\"content\":\"北京\"},{\"desc\":\"发票代码\",\"name\":\"invoiceCode\",\"content\":\"011001900104\"},{\"desc\":\"发票号码\",\"name\":\"invoiceNumber\",\"content\":\"54333909\"},{\"desc\":\"开票日期\",\"name\":\"billingDate\",\"content\":\"2020-11-27\"},{\"desc\":\"购方名称\",\"name\":\"purchaserName\",\"content\":\"新乡市万景网络技术有限公司\"},{\"desc\":\"购方税号\",\"name\":\"purchaserTaxNo\",\"content\":\"91410700099203608N\"},{\"desc\":\"购方地址电话\",\"name\":\"purchaserAddressPhone\",\"content\":\"新乡市向阳路264号 0373-3046777\"},{\"desc\":\"购方开户行账户\",\"name\":\"purchaserBank\",\"content\":\"中国银行新乡牧野支行 262429615691\"},{\"desc\":\"销方名称\",\"name\":\"salesName\",\"content\":\"霆智网络科技股份有限公司\"},{\"desc\":\"销方税号\",\"name\":\"salesTaxNo\",\"content\":\"91110228MA01N4FJ5F\"},{\"desc\":\"销方地址电话\",\"name\":\"salesAddressPhone\",\"content\":\"北京市密云区经济开发区兴盛南路8号开发区办公楼501室-2680（经济开发区集中办公区） 010-59695527\"},{\"desc\":\"销方开户行账户\",\"name\":\"salesBank\",\"content\":\"中国建设银行股份有限公司北京朝阳支行11050166360000003519\"},{\"desc\":\"合计金额\",\"name\":\"totalAmount\",\"content\":\"10398.23\"},{\"desc\":\"合计税额\",\"name\":\"totalTax\",\"content\":\"1351.77\"},{\"desc\":\"价税合计\",\"name\":\"amountTax\",\"content\":\"11750.0\"},{\"desc\":\"价税合计_中文\",\"name\":\"amountTaxCn\",\"content\":\"壹万壹仟柒佰伍拾圆整\"},{\"desc\":\"备注\",\"name\":\"remarks\",\"content\":\"\"},{\"desc\":\"机器编码\",\"name\":\"machineCode\",\"content\":\"661927869033\"},{\"desc\":\"校验码\",\"name\":\"checkCode\",\"content\":\"58948568512889866678\"},{\"desc\":\"发票状态\",\"name\":\"state\",\"content\":\"1\"}]}]}}\n";
//        WxApiResponseData wxApiResponseData = JSON.parseObject(invoiceResult, WxApiResponseData.class);
//        System.out.println(wxApiResponseData);

        String invoiceResult ="{\"code\":200,\"inArea\":\"重庆\",\"inDate\":\"20100417\",\"inCode\":\"50****2130\",\"inTotalAmtCn\":\"叁万贰仟捌佰肆拾玖圆叁角零分整\",\"salerInfo\":{\"addressPhone\":\"重庆市**街道131****3456\",\"name\":\"重庆市****有限公司\",\"taxNo\":\"925**********29\",\"account\":\"重庆******分理处030*****0007716\"},\"inTaxAmt\":\"325.23\",\"message\":\"发票查验成功\",\"inTotalAmt\":\"32849.3\",\"buyerInfo\":{\"addressPhone\":\"重庆市**广场 023-89****20\",\"name\":\"重庆***有限公司\",\"taxNo\":\"915********0265\",\"account\":\"中国建设银行**支行营业部50****521\"},\"tradeInfos\":[{\"tradeAmt\":\"1922.28\",\"unitPrice\":\"17.475247524752475\",\"taxRate\":\"0.01\",\"number\":\"110\",\"tradeName\":\"*非金属矿物制品*砼预制过梁\",\"unit\":\"根\",\"typeNo\":\"1000*100*60\",\"taxAmt\":\"19.22\"}],\"inNo\":\"0*****76\",\"inCheckCode\":\"069**********813\",\"inAmt\":\"32524.07\",\"inMachineNo\":\"499******25\",\"inType\":\"增值税专用发票\",\"remarks\":\"\"}\n";
//
//        File file = new File("logs/ticket.pdf");
//        file.createNewFile();
//        new ProducePDF(file).generatePDF();
//        System.out.println("PDF生产完成");

    }
}
